package com.yanqu.road.entity.activity.ghost.config;

import com.yanqu.road.entity.activity.ActivityInfo;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class GhostConfig {

    private int activityId;
    private ActivityInfo activityInfo;

    /**
     * 体力
     */
    private int maxEnergy;                  // 体力上限
    private long energyRecoveryTime;        // 体力恢复间隔

    /**
     * 购买体力
     */
    private int buyEnergyBaseIngots; // 购买体力消耗基础元宝
    private int buyEnergyIncrIngots; // 购买体力消耗递增元宝
    private int buyEnergyGetCount;   // 购买体力获得的数量
    private int onceEnergyBuyTimes;  // 单次体力购买次数上限

    /**
     * 商会情报
     */
    private int maxAliveNewsCount;    // 有效情报数量
    private int maxDeadNewsCount;     // 无效情报数量

    /**
     * boss
     */
    private List<GhostBossConfig> bossConfigList;
    // 天数 放大系数
    private Map<Integer,Integer> abilityEnlargeMap;                 // 能力值放大系数（千分比）
    private List<Integer> hpDayList;            // 血量天数参数（和hpValueList一一对应）
    private List<Integer> hpValueList;          // 血量放大参数（千分比）

    /**
     * 战斗
     */
    private int freeAttackTimes;                            // 免费战斗次数
    private int attackCostToTokenCoefficient;               // 出战消耗转换鬼市信物比例
    private int freeAttackGetTokenCount;                    // 免费打boss获得信物数量
    private List<Integer> attackCostItemCountList;          // 付费战斗消耗道具数量
    private int attackCostItemId;                           // 付费战斗消耗道具ID
    private List<Integer> damageToScoreRatioList;           // 伤害转换积分比例
    private List<Integer> scoreDayList;                     // 积分天数参数（和scoreValueList一一对应）
    private List<Integer> scoreValueList;                   // 积分放大参数（千分比）

    /**
     * 探索
     */
    private List<Integer> eventWeightList;  // 事件权重：头目，货箱，闷包
    private int exploreGetTokenCount;       // 探索奖励信物数量
    private int bigBossAddiTimes = Integer.MAX_VALUE;       // 活阎王探索加成所需次数
    private int bigBossAddiWeight = 0;                      // 活阎王探索加成权重

    /**
     * 货箱
     */
    private long boxExpireTime;                           // 货箱过期时间，这个值不用了
    private List<GhostBoxConfig> boxConfigList;           // <货箱ID，配置>

    /**
     * 闷包
     */
    private List<GhostGuessConfig> guessConfigList;             // 闷包配置
    private String guessCost;                                   // 闷包事件消耗
    private int guessRealRatio;                                 // 猜中概率
    private int guessNpcId;                                     // npcId

    /**
     * 送财
     */
    private String disperseBaseReward;                          // 基础送财奖励
    private String bigBossFindReward;                           // 最终Boss发现奖励
    private List<GhostDisperseConfig> disperseConfigList;       // 送财奖励

    private String disperseBaseReward2;                         // boss全清基础送财奖励
    private String finalKillReward;                             // 击杀最后一只boss奖励
    private List<GhostDisperseConfig> disperseConfigList2;      // boss全清送财奖励

    /**
     * buff
     */
    private int attackBuffId;                           // buff配置

    /**
     * 操作时间
     */
    private long startOperationTime;                // 开始操作时间
    private long endOperationTime;                  // 结束操作时间

    /**
     * 道具Id
     */
    private int tokenId;            // 鬼市信物ID
    private int scoreId;            // 积分道具ID

    /**
     * 开关
     */
    private int attackBuffSwitch;       // 鬼市百则buff开关，0关闭，1开启

    /**
     * 最终boss阶段配置
     */
    private int bigBossStageCount;                              // 最终boss阶段数
    private List<String> bigBossStageRewardList;                // 最终boss阶段奖励
    private List<Integer> bigBossStageWeightLis;                // 最终boss阶段奖励权重
    private int bigBossStageScoreParam;                         // 最终boss阶段积分奖励千分比（和boss实际血量计算）

    /**
     * 援兵配置
     */
    private long yuanBingTriggerEndTime;             // 触发援兵结束时间（小于这个时间）
    private long yuanBingTriggerHpPercent;           // 触发援兵血量百分比（低于这个千分比）
    private List<Integer> yuanBingBossTypeList;      // 援兵boss类型配置
    private List<Integer> yuanBingBossCountList;     // 援兵boss数量配置

    /**
     * 刷新时间点
     */
    private List<Long> refreshTimeList;

    private int autoBattleLimit;

    private List<Integer> bossHpParam1; // 玩家占比分层系数
    private List<List<Integer>> bossHpParam2; // 血量系数配置(第一天#第二天#第三天）

    public String getDisperseBaseReward() {
        return disperseBaseReward;
    }

    public void setDisperseBaseReward(String disperseBaseReward) {
        this.disperseBaseReward = disperseBaseReward;
    }

    public int getOnceEnergyBuyTimes() {
        return onceEnergyBuyTimes;
    }

    public void setOnceEnergyBuyTimes(int onceEnergyBuyTimes) {
        this.onceEnergyBuyTimes = onceEnergyBuyTimes;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public void setActivityInfo(ActivityInfo activityInfo) {
        this.activityInfo = activityInfo;
    }

    public void setMaxEnergy(int maxEnergy) {
        this.maxEnergy = maxEnergy;
    }

    public void setEnergyRecoveryTime(long energyRecoveryTime) {
        this.energyRecoveryTime = energyRecoveryTime;
    }

    public void setBuyEnergyBaseIngots(int buyEnergyBaseIngots) {
        this.buyEnergyBaseIngots = buyEnergyBaseIngots;
    }

    public void setBuyEnergyIncrIngots(int buyEnergyIncrIngots) {
        this.buyEnergyIncrIngots = buyEnergyIncrIngots;
    }

    public void setBuyEnergyGetCount(int buyEnergyGetCount) {
        this.buyEnergyGetCount = buyEnergyGetCount;
    }

    public void setMaxAliveNewsCount(int maxAliveNewsCount) {
        this.maxAliveNewsCount = maxAliveNewsCount;
    }

    public void setMaxDeadNewsCount(int maxDeadNewsCount) {
        this.maxDeadNewsCount = maxDeadNewsCount;
    }

    public void setBossConfigList(List<GhostBossConfig> bossConfigList) {
        this.bossConfigList = bossConfigList;
    }

    public void setBigBossFindReward(String bigBossFindReward) {
        this.bigBossFindReward = bigBossFindReward;
    }

    public void setFreeAttackTimes(int freeAttackTimes) {
        this.freeAttackTimes = freeAttackTimes;
    }

    public void setAttackCostToTokenCoefficient(int attackCostToTokenCoefficient) {
        this.attackCostToTokenCoefficient = attackCostToTokenCoefficient;
    }

    public void setFreeAttackGetTokenCount(int freeAttackGetTokenCount) {
        this.freeAttackGetTokenCount = freeAttackGetTokenCount;
    }

    public void setAttackCostItemCountList(List<Integer> attackCostItemCountList) {
        this.attackCostItemCountList = attackCostItemCountList;
    }

    public void setAttackCostItemId(int attackCostItemId) {
        this.attackCostItemId = attackCostItemId;
    }

    public void setDamageToScoreRatioList(List<Integer> damageToScoreRatioList) {
        this.damageToScoreRatioList = damageToScoreRatioList;
    }

    public void setEventWeightList(List<Integer> eventWeightList) {
        this.eventWeightList = eventWeightList;
    }

    public void setExploreGetTokenCount(int exploreGetTokenCount) {
        this.exploreGetTokenCount = exploreGetTokenCount;
    }

    public void setBoxExpireTime(long boxExpireTime) {
        this.boxExpireTime = boxExpireTime;
    }

    public void setBoxConfigList(List<GhostBoxConfig> boxConfigList) {
        this.boxConfigList = boxConfigList;
    }

    public void setGuessConfigList(List<GhostGuessConfig> guessConfigList) {
        this.guessConfigList = guessConfigList;
    }

    public void setGuessCost(String guessCost) {
        this.guessCost = guessCost;
    }

    public void setGuessRealRatio(int guessRealRatio) {
        this.guessRealRatio = guessRealRatio;
    }

    public void setDisperseConfigList(List<GhostDisperseConfig> disperseConfigList) {
        this.disperseConfigList = disperseConfigList;
    }

    public void setAttackBuffId(int attackBuffId) {
        this.attackBuffId = attackBuffId;
    }

    public void setStartOperationTime(long startOperationTime) {
        this.startOperationTime = startOperationTime;
    }

    public void setEndOperationTime(long endOperationTime) {
        this.endOperationTime = endOperationTime;
    }

    public void setTokenId(int tokenId) {
        this.tokenId = tokenId;
    }

    public void setScoreId(int scoreId) {
        this.scoreId = scoreId;
    }

    public void setAbilityEnlargeMap(Map<Integer,Integer> abilityEnlargeMap) {
        this.abilityEnlargeMap = abilityEnlargeMap;
    }

    public void setHpDayList(List<Integer> hpDayList) {
        this.hpDayList = hpDayList;
    }

    public void setHpValueList(List<Integer> hpValueList) {
        this.hpValueList = hpValueList;
    }

    public int getActivityId() {
        return activityId;
    }

    public ActivityInfo getActivityInfo() {
        return activityInfo;
    }

    public int getMaxEnergy() {
        return maxEnergy;
    }

    public long getEnergyRecoveryTime() {
        return energyRecoveryTime;
    }

    public int getBuyEnergyBaseIngots() {
        return buyEnergyBaseIngots;
    }

    public int getBuyEnergyIncrIngots() {
        return buyEnergyIncrIngots;
    }

    public int getBuyEnergyGetCount() {
        return buyEnergyGetCount;
    }

    public int getMaxAliveNewsCount() {
        return maxAliveNewsCount;
    }

    public int getMaxDeadNewsCount() {
        return maxDeadNewsCount;
    }

    public List<GhostBossConfig> getBossConfigList() {
        return bossConfigList;
    }

    public String getBigBossFindReward() {
        return bigBossFindReward;
    }

    public int getFreeAttackTimes() {
        return freeAttackTimes;
    }

    public int getAttackCostToTokenCoefficient() {
        return attackCostToTokenCoefficient;
    }

    public int getFreeAttackGetTokenCount() {
        return freeAttackGetTokenCount;
    }

    public List<Integer> getAttackCostItemCountList() {
        return attackCostItemCountList;
    }

    public int getAttackCostItemId() {
        return attackCostItemId;
    }

    public List<Integer> getDamageToScoreRatioList() {
        return damageToScoreRatioList;
    }

    public List<Integer> getEventWeightList() {
        return eventWeightList;
    }

    public int getExploreGetTokenCount() {
        return exploreGetTokenCount;
    }

    public long getBoxExpireTime() {
        return boxExpireTime;
    }

    public List<GhostBoxConfig> getBoxConfigList() {
        return boxConfigList;
    }

    public List<GhostGuessConfig> getGuessConfigList() {
        return guessConfigList;
    }

    public String getGuessCost() {
        return guessCost;
    }

    public int getGuessRealRatio() {
        return guessRealRatio;
    }

    public List<GhostDisperseConfig> getDisperseConfigList() {
        return disperseConfigList;
    }

    public int getAttackBuffId() {
        return attackBuffId;
    }

    public long getStartOperationTime() {
        return startOperationTime;
    }

    public long getEndOperationTime() {
        return endOperationTime;
    }

    public int getTokenId() {
        return tokenId;
    }

    public int getScoreId() {
        return scoreId;
    }

    public int getAbilityEnlargeValue(int openDays) {
        int day = Integer.MAX_VALUE;
        int enlargeValue = 0;
        int maxDays = 0;
        for (Map.Entry<Integer, Integer> entry : abilityEnlargeMap.entrySet()) {
            Integer days = entry.getKey();
            if (days >= maxDays) {
                maxDays = days;
            }
            if (openDays < days && days < day) {
                //如果当前天数大于配置
                enlargeValue = entry.getValue();
                day = days;
            }
        }
        if (openDays >= maxDays) {
           enlargeValue =  abilityEnlargeMap.get(maxDays);
        }
        return enlargeValue;
    }

    public Map<Integer, Integer> getAbilityEnlargeMap() {
        return abilityEnlargeMap;
    }

    public static void main(String[] args) {
        GhostConfig ghostConfig = new GhostConfig();
        Map<Integer, Integer> map = new HashMap<>();
        map.put(15,0);
        map.put(30,200);
        map.put(45,400);
        map.put(75,800);
        map.put(90,1000);
        map.put(120,1200);
        map.put(150,1400);
        map.put(180,1600);
        map.put(210,1800);
        map.put(240,2000);
        map.put(270,2200);
        ghostConfig.setAbilityEnlargeMap(map);

         ghostConfig.getAbilityEnlargeValue(14);
        ghostConfig.getAbilityEnlargeValue(30);
       ghostConfig.getAbilityEnlargeValue(31);
        ghostConfig.getAbilityEnlargeValue(44);
        ghostConfig.getAbilityEnlargeValue(271);
    }

    public List<Integer> getHpDayList() {
        return hpDayList;
    }

    public List<Integer> getHpValueList() {
        return hpValueList;
    }

    public int getGuessNpcId() {
        return guessNpcId;
    }

    public void setGuessNpcId(int guessNpcId) {
        this.guessNpcId = guessNpcId;
    }

    public int getAttackBuffSwitch() {
        return attackBuffSwitch;
    }

    public void setAttackBuffSwitch(int attackBuffSwitch) {
        this.attackBuffSwitch = attackBuffSwitch;
    }

    public int getBigBossStageCount() {
        return bigBossStageCount;
    }

    public void setBigBossStageCount(int bigBossStageCount) {
        this.bigBossStageCount = bigBossStageCount;
    }

    public List<String> getBigBossStageRewardList() {
        return bigBossStageRewardList;
    }

    public void setBigBossStageRewardList(List<String> bigBossStageRewardList) {
        this.bigBossStageRewardList = bigBossStageRewardList;
    }

    public List<Integer> getBigBossStageWeightLis() {
        return bigBossStageWeightLis;
    }

    public void setBigBossStageWeightLis(List<Integer> bigBossStageWeightLis) {
        this.bigBossStageWeightLis = bigBossStageWeightLis;
    }

    public long getYuanBingTriggerEndTime() {
        return yuanBingTriggerEndTime;
    }

    public void setYuanBingTriggerEndTime(long yuanBingTriggerEndTime) {
        this.yuanBingTriggerEndTime = yuanBingTriggerEndTime;
    }

    public long getYuanBingTriggerHpPercent() {
        return yuanBingTriggerHpPercent;
    }

    public void setYuanBingTriggerHpPercent(long yuanBingTriggerHpPercent) {
        this.yuanBingTriggerHpPercent = yuanBingTriggerHpPercent;
    }

    public List<Integer> getYuanBingBossTypeList() {
        return yuanBingBossTypeList;
    }

    public void setYuanBingBossTypeList(List<Integer> yuanBingBossTypeList) {
        this.yuanBingBossTypeList = yuanBingBossTypeList;
    }

    public List<Integer> getYuanBingBossCountList() {
        return yuanBingBossCountList;
    }

    public void setYuanBingBossCountList(List<Integer> yuanBingBossCountList) {
        this.yuanBingBossCountList = yuanBingBossCountList;
    }

    public List<GhostDisperseConfig> getDisperseConfigList2() {
        return disperseConfigList2;
    }

    public void setDisperseConfigList2(List<GhostDisperseConfig> disperseConfigList2) {
        this.disperseConfigList2 = disperseConfigList2;
    }

    public String getFinalKillReward() {
        return finalKillReward;
    }

    public void setFinalKillReward(String finalKillReward) {
        this.finalKillReward = finalKillReward;
    }

    public String getDisperseBaseReward2() {
        return disperseBaseReward2;
    }

    public void setDisperseBaseReward2(String disperseBaseReward2) {
        this.disperseBaseReward2 = disperseBaseReward2;
    }

    public int getBigBossStageScoreParam() {
        return bigBossStageScoreParam;
    }

    public void setBigBossStageScoreParam(int bigBossStageScoreParam) {
        this.bigBossStageScoreParam = bigBossStageScoreParam;
    }

    public List<Long> getRefreshTimeList() {
        return refreshTimeList;
    }

    public void setRefreshTimeList(List<Long> refreshTimeList) {
        this.refreshTimeList = refreshTimeList;
    }

    public List<Integer> getScoreDayList() {
        return scoreDayList;
    }

    public void setScoreDayList(List<Integer> scoreDayList) {
        this.scoreDayList = scoreDayList;
    }

    public List<Integer> getScoreValueList() {
        return scoreValueList;
    }

    public void setScoreValueList(List<Integer> scoreValueList) {
        this.scoreValueList = scoreValueList;
    }

    public int getBigBossAddiTimes() {
        return bigBossAddiTimes;
    }

    public void setBigBossAddiTimes(int bigBossAddiTimes) {
        this.bigBossAddiTimes = bigBossAddiTimes;
    }

    public int getBigBossAddiWeight() {
        return bigBossAddiWeight;
    }

    public void setBigBossAddiWeight(int bigBossAddiWeight) {
        this.bigBossAddiWeight = bigBossAddiWeight;
    }

    public int getAutoBattleLimit() {
        return autoBattleLimit;
    }

    public void setAutoBattleLimit(int autoBattleLimit) {
        this.autoBattleLimit = autoBattleLimit;
    }

    public List<Integer> getBossHpParam1() {
        return bossHpParam1;
    }

    public void setBossHpParam1(List<Integer> bossHpParam1) {
        this.bossHpParam1 = bossHpParam1;
    }

    public List<List<Integer>> getBossHpParam2() {
        return bossHpParam2;
    }

    public void setBossHpParam2(List<List<Integer>> bossHpParam2) {
        this.bossHpParam2 = bossHpParam2;
    }
}
